package servlet;

import javax.servlet.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;

public class MyServlet extends GenericServlet {
    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        servletResponse.setCharacterEncoding("UTF-8");
        servletResponse.setContentType("text/html");
        ServletOutputStream out = servletResponse.getOutputStream();
        out.write("姓名：顾建宇".getBytes(StandardCharsets.UTF_8));
        out.write("</br>".getBytes(StandardCharsets.UTF_8));
        out.write("学号：2023022026".getBytes(StandardCharsets.UTF_8));
        out.flush();
        out.close();
    }
}
